package com.mms.action.person;

import java.util.List;

import com.mms.dao.DepartmentManagementDao;
import com.mms.dao.PersonManagementDao;
import com.mms.entity.Department;
import com.mms.entity.Staff;
import com.opensymphony.xwork2.Action;

public class GetSearchPersonAction implements Action{

	private String searchMes;
	private List<Staff> staffs;
	private List<Department> depmes;
	
	
	public String getSearchMes() {
		return searchMes;
	}


	public void setSearchMes(String searchMes) {
		this.searchMes = searchMes;
	}


	public List<Staff> getStaffs() {
		return staffs;
	}


	public void setStaffs(List<Staff> staffs) {
		this.staffs = staffs;
	}


	public List<Department> getDepmes() {
		return depmes;
	}


	public void setDepmes(List<Department> depmes) {
		this.depmes = depmes;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		PersonManagementDao pmd = new PersonManagementDao();
		DepartmentManagementDao dmd = new DepartmentManagementDao();
		staffs = pmd.getSearchStaffs(searchMes);
		depmes = dmd.getDepartments();
		return "success";
	}

}
